package com.example.adminbase;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.MessageSource;
import org.springframework.context.annotation.Bean;
import org.springframework.context.support.ReloadableResourceBundleMessageSource;

@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
@MapperScan("com.example.adminbase.dao")
public class AdminBaseApplication {

    public static void main(String[] args) {
        SpringApplication.run(AdminBaseApplication.class, args);
    }

    @Bean
    public MessageSource messageSource() {
        ReloadableResourceBundleMessageSource reloadableResourceBundleMessageSource = new ReloadableResourceBundleMessageSource();
        reloadableResourceBundleMessageSource.setBasename("classpath:message");
        reloadableResourceBundleMessageSource.setDefaultEncoding("utf-8");
        return reloadableResourceBundleMessageSource;
    }

}
